import java.util.Random;

public class Test {
    public static void main(String[] args) {
        int[] array = new int[100000];
        Random random = new Random();
        for (int i = 0; i < array.length; i++) {
            array[i] = random.nextInt();
        }

        int[] b = new int[100000];
        System.arraycopy(array, 0, b, 0, array.length);
        int[] i = new int[100000];
        System.arraycopy(array, 0, i, 0, array.length);
        int[] m = new int[100000];
        System.arraycopy(array, 0, m, 0, array.length);
        int[] q = new int[100000];
        System.arraycopy(array, 0, q, 0, array.length);
        int[] se = new int[100000];
        System.arraycopy(array, 0, se, 0, array.length);
        int[] sh = new int[100000];
        System.arraycopy(array, 0, sh, 0, array.length);

        long startTime = System.currentTimeMillis();
        BubbleSort.sort(b);
        long endTime = System.currentTimeMillis();
        System.out.println("Bubble Sort运行时间：" + (endTime - startTime) + "ms");

        startTime = System.currentTimeMillis();
        InsertionSort.sort(i);
        endTime = System.currentTimeMillis();
        System.out.println("Insertion Sort运行时间：" + (endTime - startTime) + "ms");

        startTime = System.currentTimeMillis();
        MergeSort.sort(m);
        endTime = System.currentTimeMillis();
        System.out.println("Merge Sort运行时间：" + (endTime - startTime) + "ms");

        startTime = System.currentTimeMillis();
        QuickSort.sort(q);
        endTime = System.currentTimeMillis();
        System.out.println("Quick Sort运行时间：" + (endTime - startTime) + "ms");

        startTime = System.currentTimeMillis();
        SelectionSort.sort(se);
        endTime = System.currentTimeMillis();
        System.out.println("Selection Sort运行时间：" + (endTime - startTime) + "ms");

        startTime = System.currentTimeMillis();
        ShellsSort.sort(sh);
        endTime = System.currentTimeMillis();
        System.out.println("Shell's Sort运行时间：" + (endTime - startTime) + "ms");
    }
}
